package com.tbit.uqbike.client.service.impl;

import com.tbit.uqbike.client.dao.core.CouponDao;
import com.tbit.uqbike.client.pojo.Coupon;
import com.tbit.uqbike.client.service.CouponService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: chen
 * @Description: 优惠券
 * @Date: 创建于 14:10 2020/1/4
 */
@Service("couponService")
public class CouponServiceImpl implements CouponService {
    @Autowired
    private CouponDao couponDao;

    @Override
    public Coupon getByCouponId(Integer couponId) {
        return couponDao.getByCouponId(couponId);
    }

    @Override
    public Coupon getByName(String name, Integer accountId) {
        Map<String, Object> map = new HashMap<>();
        map.put("name", name);
        map.put("accountId", accountId);
        return couponDao.getByName(map);
    }
}
